1. Field of the Invention
The invention disclosed broadly relates to the field of computer software development and more particularly relates to the field of software toolkits for application development for Java Applications and Java Applets. The invention provides software developers with a consistent Input/Output (I/O) function interface for both Java Applications and Java Applets.
2. Description of the Related Art
Java is a programming language developed by Sun Microsystems. The basic idea behind Java programming is that the same Java software code can run on many different kinds of computers. Stated differently, the goal of Java is to write software once to be run on any Java compliant platform. These different platforms include both different hardware platforms, e.g., RISC, PC, Macintosh, Sparc and different operating system platforms, e.g., Windows 95/NT, Unix, AIX, Copeland. These platforms cover a large class of completely different machines from large servers to thin clients to small portable consumer devices such as personal digital assistants. Software programming tools are available from a variety of suppliers including Sun Microsystems (refer to online URL www.sun.com/java) for developing Java-based software applications, or more simply called Java Applications. Software tools for performing I/O (Input/Output) operations for Java Applications are called the Java I/O Toolkit. This Java I/O Toolkit provides software developers with a library of object oriented functions for reading and writing to files that are local to the hardware platform in which the Java Application is executing. Other Java I/O Toolkit functions include performing other I/O function across a network. One example is the reading and writing of files to remote servers.
During the development of Java, the Internet and more particular the World Wide Web ("Web") has become immensely popular largely because of the ease of finding information and the user-friendliness of today's browsers. A feature known as hypertext allows a user to access information from one Web page to another Web page by simply pointing (using a pointing device such as a mouse) at the hypertext and clicking. Another feature that makes the Web attractive is having the ability to process the information (or content) in remote Web pages without the requirement of having a specialized application program for each kind of content accessed. Thus, the same content is viewed across different platforms. Browser technology has evolved to enable running of applications that manipulate this content across a wide variety of different platforms.
In 1995, Sun Microsystems formally introduced HotJava. HotJava is a Web browser that can run Java code. Other Web browsers such as Netscape Navigator and Microsoft Internet Explorer have since added Java capability to their base Web browser products. The combination of Web browser technology combined with Java technology has increased the fundamental of appeal of Java, i.e., the ability to write an application once and run the application across a variety of platforms including Web browsers, and while most of the Java code is portable across platforms, including Java-compliant Web browsers, some functions such as returning handles to frames or the handling of Input/Output (I/O) are not portable. Two categories of Java-based programs are necessary. The first category of Java base programs is called a Java Application that runs across computer platforms without being combined with a Web browser. The second category of Java-based programs is called Java Applets that run across systems using Java compliant Web browsers. The reason many functions are not compatible across Java runtime environments of Applets and Applications is due to security concerns. Java Applets are typically loaded by a Web browser being accessed. The Applet by design cannot write to or read from local storage devices. This deliberate limitation for I/O is designed to minimize the destructive use of Java Applets as computer viruses that unknowingly make changes to the compute system of the end user. A Java Applet with local write and read access then could easily create havoc by deleting, renaming, scrambling and otherwise corrupting a user computer system.
Both of these categories of Java-based programs, Java Application and Java Applets, require specialized I/O handling. This specialized I/O is handled by the use of two different Java Classes in the Java I/O toolkit, one class for Java Applets and one class for Java Applications. Because of the requirement of two classes, a developer wishing to create a Java-based software application must treat each run time environment, i.e., Java Applets and Java Applications differently. Because of these different Java I/O toolkit requirements, a software developer is forced to develop separate codes to handle each of these two Java I/O classes. Accordingly, there is a need for a method to provide an I/O class interface that can be used both by Java Applications and Java Applets which overcomes the above problems.
Another problem with using either a Java application or is in the process of writing of an output stream. The HTTP (Hypertext Transfer Protocol) is an application-level protocol with the lightness and speed necessary for distributed collaborative computing in which the Internet is based. More information on the HTTP/1.0 protocol is available via online URL http://www.w3.org/Protocols/rfc1945/rfc1945 from the World Wide Web (W3) Consortium. When an application, using the HTTP protocol transfers data to a servlet, a requirement of HTTP protocol is that the data (called the entity-body) must include the length of the message being sent (called content-length). This requirement of writing the length of the message prior to sending the message can be a problem if the application does not know the length of the message prior to sending the message. An alternate method to transfer data of unknown length, as taught by the HTTP/1.0 protocol, is to terminate the connection between the application and the server. However, the requirement of having to reestablish a connection can be burdensome, especially for an application that requires the transfer of data frequently and repeatedly. Accordingly, there is a need for a method to write a message of unknown length in a Java program without terminating the connection to the server.
Still, another problem, with using a Java application to transfer data or messages of unknown length to a sever, is the desire by software to have one solution work for both Java Applications and Java Applets. Therefore, a need exists to provide one method to transfer data of unknown length that can be used both by Java Applications and Java Applets.